Performing slice based operations in a data plane circuit

ABSTRACT

Some embodiments of the invention provide a novel method of performing network slice-based operations on a data message at a hardware forwarding element (HFE) in a network. For a received data message flow, the method has the HFE identify a network slice associated with the received data message flow. This network slice in some embodiments is associated with a set of operations to be performed on the data message by several network elements, including one or more machines executing on one or more computers in the network. Once the network slice is identified, the method has the HFE process the data message flow based on a rule that applies to data messages associated with the identified slice.

In recent years, there has been a proliferation of Software-DefinedDatacenters (SDDC), and software tools for defining and controllingcomputer and network services in the SDDCs. Some of these tools definelogical network resources (e.g., logical switches, logical routers,logical middlebox elements) that span multiple physical constructs(e.g., multiple host computers, etc.). However, many of these toolsoften ignore a large part of SDDCs, which are the underlay networkelements of these datacenters. Examples of these network elementsinclude hardware switches (e.g., top-of-rack switches, spine switches,etc.), hardware routers, hardware middlebox appliances, etc.

BRIEF SUMMARY

Some embodiments of the invention provide a novel method of performingnetwork slice-based operations on a data message at a hardwareforwarding element (HFE) in a network. For a received data message flow,the method has the HFE identify a network slice associated with thereceived data message flow. This network slice in some embodiments isassociated with a set of operations to be performed on the data messageby several network elements, including one or more machines executing onone or more computers in the network. The network in some embodiments isa telecommunication network, and the operations are part of a chain ofservice operations that the network performs on data messages from itsdevices (e.g., the mobile devices in the network). Once the networkslice is identified, the method has the HFE process the data messageflow based on a rule that applies to data messages associated with theidentified slice.

In some embodiments, the HFE includes a data plane (DP) circuit (e.g.,an application specific integrated circuit, ASIC) that receives datamessages and forwards the data messages in the network. In some of theseembodiments, the DP circuit identifies the flow's network slice byidentifying a slice identifier associated with the network slice. The DPcircuit in these embodiments then processes the data message flow by (1)using the slice identifier to identify a rule stored in the DP circuit,and (2) performing an operation on the data message that is associatedwith the identified rule. The HFE in some embodiments also includes acontrol plane circuit (e.g., a microprocessor and associated program)for providing configuration data that configures the DP circuit withrules for processing data messages.

In some embodiments, the DP circuit identifies the rule associated withthe received data message flow by matching the slice identifier that itidentifies for the data message flow with a slice identifier that ispart of a rule identifier of the rule. The identified rule in someembodiments is a forwarding rule that specifies a forwarding operationto forward the data message flow to a particular port of the HFE. Insome embodiments, the slice-based forwarding rules are next-hopforwarding rules that specify next hops of different paths to the samedestinations in the network. In other embodiments, the slice-basedforwarding rules are next-hop forwarding rules that specify differentnext hops of different paths to different destinations in the network.For instance, in some embodiments, the different slice-based forwardingrules select different ports connected to different datacenters forprocessing the data message flows that are associated with the differentslice identifiers. In some embodiments, the slice-based forwarding rulescan specify logical forwarding operations of logical forwarding elementsthat are defined to span multiple physical forwarding elements.

The identified rule in some embodiments is a middlebox service rule thatis associated with a middlebox service operation to perform on the datamessage flow. For instance, in some embodiments, the identified rule isa firewall rule that determines whether to drop or allow the datamessages of the flow based on the flow's associated slice identifier. Inother embodiments, the identified rule is a load balancing rule thatspecifies a load balancing operation to perform on the data message flowbased on its associated slice identifier. This load balancing operationin some embodiments distributes the data message load among severaldifferent destinations or different paths in the network based on theslice identifiers associated with these data message flows.

As mentioned above, some embodiments specify for a network slice a setof operations to perform on the data message flows that are associatedwith the network slice. These operations in some embodiments includeseveral operations performed by several devices in the network. In someembodiments, these devices include machines executing on host computersto perform at least one or more of the operations associated with thenetwork slice. These machines in some embodiments include virtualmachines (VMs) and/or containers. Also, in some embodiments, theoperations that these machines perform are virtual network functions(VNFs) implemented by a telecommunication network. These VNFs are partof service chains performed by the telecommunication network'sinfrastructure on the data message flows passing through the network. Insome embodiments, different network slices correspond to different typesof traffic passing through the telecommunication network.

The HFE uses different techniques in different embodiments to identify anetwork slice for a received data message flow. In some embodiments, theHFE forwards the data messages of the flow to an external deviceseparate from the HFE. This external device analyzes the data messagesthat it receives, identifies the associated slice identifier for theflow, and configures the HFE (e.g., the HFE DP circuit through an API(application programming interface) call to the HFE's CP circuit) with amatch record to use to match subsequent data messages of the flow withthe flow's slice ID. This external device in some embodiments forwardsthe data messages that it receives to their next-hop destinations,before the HFE has been configured with the match record. The externaldevice in some embodiments is a standalone appliance, while in otherembodiments is a host computer on which a machine executes to analyzedata messages received from the HFE in order to ascertain theirassociated slice identifiers.

In other embodiments, the HFE's DP circuit forwards the received datamessage flow to the HFE's CP circuit, which then identifies the sliceidentifier for the received data message and provides this sliceidentifier back to the DP circuit along with the data message forprocessing. In some embodiments, the CP circuit provides the sliceidentifier as part of a configuration data that configures the HFE(e.g., the HFE DP circuit through its CP circuit) with a match record touse to match subsequent data messages of the flow with the flow's sliceID.

In some embodiments, the CP circuit executes a resource sharing programand a machine that executes on top of this program identifies the sliceidentifier for the received data message. In some embodiments, theprogram is a virtualization program (e.g., a hypervisor) or a Linuxoperating system, and the machine is a virtual machine or container. TheCP circuit's resource sharing program in some embodiments is ahypervisor that includes a context engine that associates data messageattributes with slice identifiers. This context engine uses a set ofattributes of the received data message flow to identify the sliceidentifier for the received flow.

In some embodiments, the context engine executing on the CP circuitreceives records matching data message attributes with slice identifiersfrom context engines of hypervisors executing on host computers. Inother embodiments, the CP circuit's context engine receives recordsmatching data message attributes with slice identifiers from a set ofone or more servers acting as a set of network managers or controllers.In still other embodiments, the context engine receives a recordassociating a data message flow's attribute set (e.g., its five or seventuple identifier) with a slice identifier from a virtual machine (VM)executing on top of the hypervisor.

In some embodiments, the hypervisor that executes on the HFE's CPcircuit is the same or similar to the hypervisors executing on the hostcomputers in the network. These similar or identical hypervisors providea common platform through which the managers and/or controllers in thenetwork can manage both the HFE, the host computers, and the softwareforwarding elements executing on the host computers. Specifically, inthese embodiments, the managers and/or controllers manage and/or controlthe HFE's CP circuit like they manage and/or controller the hostcomputers and the software forwarding elements executing on these hostcomputers. In some embodiments, the hypervisor executing on the HFE's CPcircuit uses the same NIC (network interface controller) data modelabstraction for the HFE's data plane circuit as the host computerhypervisors. For the hypervisor executing on the HFE's CP circuit, theseembodiments use a translator plugin to convert the hypervisorcommunication with the data plane circuit from a NIC data model formatto a DP circuit model format.

The preceding Summary is intended to serve as a brief introduction tosome embodiments of the invention. It is not meant to be an introductionor overview of all inventive subject matter disclosed in this document.The Detailed Description that follows and the Drawings that are referredto in the Detailed Description will further describe the embodimentsdescribed in the Summary as well as other embodiments. Accordingly, tounderstand all the embodiments described by this document, a full reviewof the Summary, the Detailed Description, the Drawings, and the Claimsis needed. Moreover, the claimed subject matters are not to be limitedby the illustrative details in the Summary, the Detailed Description,and the Drawings.

BRIEF DESCRIPTION OF FIGURES

The novel features of the invention are set forth in the appendedclaims. However, for purposes of explanation, several embodiments of theinvention are set forth in the following figures.

FIG. 1 illustrates an example of a software defined datacenter (SDDC)that includes several network elements that perform different chains ofoperations on different data message flows that are associated withdifferent slice identifiers corresponding to different network slices.

FIG. 2 illustrates an example of a hardware forwarding element (HFE) ofsome embodiments.

FIG. 3 illustrates an example of a data plane (DP) circuit forwardingdata messages along different paths to the same destination based onslice-based rules.

FIG. 4 illustrates two HFEs of some embodiments defining the start ofdifferent segments of a datacenter network.

FIG. 5 illustrates an example of a DP circuit forwarding data messagesalong different paths to the different destinations based on slice-basedrules

FIG. 6 illustrates an example in which the DP circuit forwards twodifferent data message flows associated with two different slice IDs totwo different sets of machines in two different datacenters.

FIG. 7 illustrates a load balancer with a DP circuit that, based on theslice IDs associated with data message flows, performs a load balancingoperation to distribute different data message flows to differentdestination nodes in different clusters.

FIG. 8 illustrates a firewall appliance with a DP circuit that, based onthe slice ID associated with data message flows, performs a firewalloperation to determine whether to allow, to drop, or to redirectdifferent data message flows.

FIG. 9 illustrates a technique in which the HFE offloads the sliceidentification for an initial set of data messages in a new flow to anexternal device.

FIG. 10 presents a process that conceptually illustrates the operationof the DP circuit of FIG. 9 in some embodiments.

FIG. 11 illustrates another approach for an HFE to identify the slice IDassociated with a newly received data message flow.

FIG. 12 illustrates an example of a hypervisor and a context engineexecuting on a control plane (CP) circuit to facilitate sliceidentification.

FIG. 13 illustrates that in some embodiments a CP circuit of an HFEexecutes one or more machines that perform one or more serviceoperations of a service chain for the data messages processed by theHFE's DP circuit.

FIG. 14 illustrates CP circuits and host computers executing similarhypervisors.

FIG. 15 illustrates that in some embodiments the hypervisors executingon the HFE's CP circuits use the same or similar data model abstractionas the hypervisors executing on host computers.

FIGS. 16 and 17 illustrate examples of using slice-based HFEs to performSD-WAN (software-defined wide access network) operations.

FIG. 18 illustrates an example of several HFEs implementing ingress-flowcontrols for a host computer.

FIG. 19 illustrates a process that a server set uses to configure theHFEs to implement ingress-flow controls for the host computer in FIG.18.

FIG. 20 conceptually illustrates a computer system with which someembodiments of the invention are implemented.

DETAILED DESCRIPTION

In the following detailed description of the invention, numerousdetails, examples, and embodiments of the invention are set forth anddescribed. However, it will be clear and apparent to one skilled in theart that the invention is not limited to the embodiments set forth andthat the invention may be practiced without some of the specific detailsand examples discussed.

Some embodiments of the invention provide a novel method of performingnetwork slice-based operations on a data message flow at a hardwareforwarding element (HFE) in a network. For a data message flow receivedby the HFE, the method has the HFE (1) identify a network sliceassociated with the received data message flow, and then (2) based onthe identified network slice, perform an operation on the received datamessage flow.

In some embodiments, the identified network slice is associated with aset of operations that need to be performed on the received data messageflow by a set of network elements. In some embodiments, a network slicerefers to the set of operations to perform on data messages associatedwith the network slice, while in other embodiments, the network slicerefers to the network elements that are to perform the set of operationon the data messages associated with the network slice. In addition tothe HFE, the set of network elements typically include other elementsthat perform one or more operations on the data message based on thedata message flow's association with the network slice. The set ofnetwork elements includes in some embodiments one or more machinesexecuting on one or more computers in the network.

The HFE in some embodiments identifies the network slice associated withthe received data message flow by identifying a slice identifier that isassociated with the received data message flow. As further describedbelow, the HFE identifies the slice identifier (ID) of the received datamessage flow differently in different embodiments, e.g., by usingprograms that the HFE executes or by using other devices and/orprograms.

After obtaining the slice ID for the received data message, the HFE insome embodiments processes the data message flow by (1) using the sliceidentifier to identify one of its rules, and (2) performing an operationon the data message flow that is associated with the identified rule.The HFE in some embodiments stores several rules that have slice IDs aspart of their rule identifiers. In these embodiments, the HFE matches adata message of the flow to a rule by matching the message's associatedslice identifier with the slice identifier in the identifier of therule.

In some embodiments, one or more service chains can be defined for eachnetwork slice, with each service chain specifying one or more orderedsequence of operations (e.g., compute operations, forwarding operations,and/or service operations, etc.) to perform on the data message flowsassociated with the chain's network slice. In some embodiments, anetwork slice is a grouping of resources (e.g., compute resources,forwarding resources, service resources, etc.) in a network (e.g., anetwork of one or more datacenters). Some embodiments allow a group ofone or more data message flows to be associated with a network slice, inorder to have the data message flows processed by the group of resourcesof the network slice.

For instance, in some embodiments, the network is a telecommunicationnetwork (e.g., a 5G telecommunication network) for which multiplenetwork slices can be defined. Examples of such slices for a 5Gtelecommunication network include a mobile broadband slice forprocessing broadband data, an IoT (Internet of Things) slice forprocessing IoT data, a telemetry slice for processing telemetry data, aVOIP (voice over IP) slice for voice over IP data, a video conferencingslice for processing video conferencing data, a device navigation slicefor processing navigation data, etc.

In this document, data messages refer to a collection of bits in aparticular format sent across a network. One of ordinary skill in theart will recognize that the term data message may be used herein torefer to various formatted collections of bits that may be sent across anetwork, such as Ethernet frames, IP packets, TCP segments, UDPdatagrams, etc. Also, as used in this document, references to L2, L3,L4, and L7 layers (or layer 2, layer 3, layer 4, and layer 7) arereferences respectively to the second data link layer, the third networklayer, the fourth transport layer, and the seventh application layer ofthe OSI (Open System Interconnection) layer model.

FIG. 1 illustrates an example of a software-defined datacenter (SDDC)100 that includes several network elements that perform different chainsof operations on different data message flows that are associated withdifferent slice identifiers corresponding to different network slices.The network elements in this example include an HFE 105 and two sets ofmachines 110 and 112 executing on two sets of host computers 115 and117. The SDDC 100 in this example also includes a set of one or moreservers 120 for managing and controlling the HFE 105 and the hostcomputers 115 and 117.

In this example, the HFE 105 receives two different data message flows125 and 130 that are associated with two different network slices. Thedata message flows in this example do not include slice IDs (e.g., intheir encapsulation headers) that identify their corresponding networkslices. Hence, the HFE 105 identifies a slice ID for each data messageflow 125 or 130. Different techniques that the HFE 105 uses in differentembodiments to identify the slice identifier for a data message flowwill be described below.

After identifying the slice ID for a particular data message flow, theHFE 105 (1) uses the identified slice ID to select a rule for forwardingthe data message flow, and (2) forwards the data messages of the flow toa set of machines 110 or 112 based on the selected rule. For instance,in some embodiments, the HFE 105 stores several next-hop forwardingrules. Each of these rules specifies a next hop for a data message ofthe flow that matches the rule. Each rule also has a rule identifierthat includes a slice identifier. In some embodiments, the ruleidentifier of a forwarding rule can also include other data messageattributes (e.g., other header fields).

The HFE 105 matches a data message with a forwarding rule by comparingthe identified slice ID for its flow with the rule identifiers of one ormore forwarding rules. This comparison in some embodiments also uses oneor more header values of the data message's flow (e.g., one or moreattributes in the five or seven tuple identifier of the flow). Aftermatching the data message with a forwarding rule, the HFE 105 then usesthe next-hop destination specified by the matching forwarding rule toforward the data message to one of the two sets of machines 110 or 112.In this example, data messages that are part of the flow 125 are sent tothe machine set 110, while the data messages that are part of the flow130 are send to the machine set 112.

In the example of FIG. 1, the two sets of machines 110 or 112 performtwo different chains of operations associated with two different networkslices. As illustrated, in each chain, some machines can run on the samehost computer, while other machines run on other host computers. Also,in this example, the different chains have a different number ofoperations. However, one of ordinary skill will realize that in someembodiments the different alternative chains can have the same number ofoperations, or even the same operations performed by different set ofcompute resources (e.g., computers, virtual machines, containers, etc.)and networking resources (e.g., switches, routers, middlebox appliances,etc.)

The machines in some embodiments include virtual machines (VMs) and/orcontainers. Also, in some embodiments, the operations that the machinesperform are virtual network functions (VNFs) implemented by atelecommunication network. The VNFs are part of service chains performedby the telecommunication network's infrastructure on the data messagespassing through the network. In some embodiments, the different networkslices correspond to different types of traffic passing through thetelecommunication network.

The server set 120 deploys and configures each of the sets of machines110 or 112 to process the data messages for a particular network sliceassociated with a particular slice ID. For instance, in someembodiments, the set of machines 110 are deployed and configured toprocess data messages associated with slice ID A, while the set ofmachines 112 are deployed and configured to process data messagesassociated with slice ID B.

Also, in some embodiments, one or more machines in the sets 110 and 112perform their operations by (1) identifying the slice ID associated witha data message flow, and (2) based on the identified slice ID, selectingan operation to perform on the data messages of the flow. However, inother embodiments, the machines 110 and 112 do not select the operationsthat they perform on the data messages that they process based on theslice IDs of these message flows. Instead, in these embodiments, thesemachines are just deployed and configured to process data messagesassociated with certain slice IDs.

The HFE 105 is a top-of-rack (TOR) switch in some embodiments. In otherembodiments, it is a gateway, e.g., a gateway at a north-south boundaryof a network. In still other embodiments, the HFE 105 is a middleboxappliance. Also, after identifying a slice ID for a data message flow,the HFE 105 in some embodiments encapsulates the data messages of thisflow with a header, and inserts the slice ID in the encapsulating headerof each data message, so that subsequent network elements can use theslice ID in performing their operations.

FIG. 2 illustrates an example of the HFE 105 of some embodiments. Asshown, the HFE 105 includes a data plane (DP) circuit 205, a controlplane (CP) circuit 210, a set of forwarding element (FE) ports 215 and aset of DP ports 220. The HFE 105 can be an edge forwarding element thatconnects to source and/or destination computers in a network, or anon-edge forwarding element that connects to other forwarding elementsin the network. Through wired or wireless connections, the HFE 105receives data messages to process from its FE ports 215, and transmitsprocessed data messages from its FE port 215. In this example, the HFE105 is shown as receiving a data message from a source machine 222 andforwarding the data message to a first hop 224 along a first servicechain.

The DP circuit 205 processes the data messages that the HFE 105receives. The DP ports 220 receive data messages from, and transmit datamessages to, the FE ports 215. The DP circuit 205 is an applicationspecific integrated circuit (ASIC) with several ingressmessage-processing pipelines 225, several egress message-processingpipelines 230 and a crossbar switch 235 that connects the ingresspipelines 225 to the egress pipelines 230. Each ingress or egresspipeline includes several message processing stages 240, each of whichcan perform one or more operations on a data message.

In some embodiments, a message processing stage 240 tries to match adata message's associated attribute set (e.g., header values, slice ID,etc.) with one or more rules that it stores. When it finds a matchingrule, the message processing stage 240 performs the operation (i.e., theaction) associated with the matching rule. In some embodiments, the CPcircuit 210 provides configuration data that configures the DP circuit205 with rules that the message processing stages 240 use in processingthe data messages. The CP circuit 210 in some embodiments includes amemory that stores a control plane program and a processor (e.g., an x86microprocessor) that executes the control plane program.

To process a data message flow based on its associated network slice,the DP circuit 205 uses one of several techniques described below tofirst identify the flow's associated slice ID that specifies its networkslice. After identifying the slice ID for the flow, the DP circuit 205in these embodiments processes the data message flow by (1) using theslice identifier to identify a rule stored in the DP circuit 205, and(2) performing an operation on the data messages of the flow that isassociated with the identified rule.

As shown in FIG. 2, a message processing stage 240 a in an ingresspipeline 225 includes a match-action table 250 that stores severalrecords 252, with each record having a match tuple 254 and an actiontuple 256. In some embodiments, the records 252 are conceptual recordsas the match and action tuples are stored in different tables but areassociated through an addressing scheme (e.g., an action tuple is storedin its action table at a location that corresponds to a location in amatch table at which its corresponding match tuple is stored). A matchtuple of each record (also called a rule) specifies a set of datamessage attributes (e.g., any of the data message seven tupleidentifiers, which are source and destination IP, source and destinationport, protocol, and source and destination MAC addresses), while theaction tuple of the record specifies the action to perform on a datamessage that matches the record's match tuple.

A message processing stage 240 compares a received data message's set ofattributes with a record's match tuple to determine whether the datamessage matches the record, and if so, it performs the action specifiedby the record's action tuple. The match tuple of each rule iseffectively the rule's identifier as it uniquely identifies the rule. Asshown, the match tuples 254 of the records 252 of the match-action table250 include the slice IDs. In addition, the match tuples of the records252 can include other attributes of the data message (e.g., any of itsfive tuple identifiers, which are source and destination IP, source anddestination port, and protocol).

To forward a data message flow from the source machine 222 to the firsthop along its service chain based on the flow's associated slice ID, themessage processing stage 240 a in some embodiments compares the slice IDassociated with a received data message of the flow with one or morematch tuples 254 of one or more records 252 in the match-action table250 to identify a record with a matching slice ID.

Upon finding a matching record, the message processing stage 240 a insome embodiments retrieves the egress port ID from the action tuple ofthe matching record. This egress port ID specifies the DP egress portfrom which the received data message should leave the DP circuit. Inthis example, the identified DP egress port is associated with the firsthop of a service chain for the network slice identified by the slice IDassociated with the data message's flow.

The egress port identifier is used subsequently by other messageprocessing stages 240 and/or crossbar switch 235 to direct the datamessage to the egress pipeline associated with the identified egressport. The egress pipeline then provides this data message to theidentified egress port, which, in turn, provides the data message to itsassociated FE egress port that then forwards the data message to thefirst hop service node 224.

In some embodiments, the slice-based forwarding rules of the DP circuit205 are next-hop forwarding rules that specify next hops of differentpaths to the same destinations in the network. FIG. 3 illustrates anexample of this. This figure illustrates a DP circuit 205 of the HFE 105forwarding two different data message flows 125 and 130 associated withtwo different slice IDs A and B to two different sets of machines 110and 112 to perform two different sets of operations on their respectivedata message flows.

After being processed by its respective set of machines 110 or 112, eachdata message flow 125 or 130 is forwarded by the software forwardingelement of the last host computer of the last machine in its set ofmachines to the same destination node 305. In some embodiments, thedestination node 305 is another machine. In other embodiments, thedestination node 305 is a middlebox appliance, or a cluster of middleboxappliances (associated with the same virtual network address, such as asame virtual IP address), that performs the same middlebox serviceoperation on both data message flows.

In still other embodiments, this destination node 305 is anotherhardware forwarding element that is associated with another segment of adatacenter network. In some of these embodiments, the HFEs 105 and 305define the start of different segments of the datacenter network, asshown in FIG. 4. In this example, three HFEs 105, 305 and 405 define twosegments 402 and 404 of the network, with the HFE 105 forwarding thedata message flows along two paths 410 and 415 based on the slice IDsassociated with these flows, while the HFE 305 forwards the data messageflows along three paths 420, 425 and 430 based on the slice IDs.

In some embodiments, the slice-based forwarding rules of the DP circuit205 are next-hop forwarding rules that specify next hops of differentpaths to different destinations in the network. FIG. 5 illustrates anexample of this. This figure illustrates a DP circuit 205 of the HFE 105forwarding two different data message flows 125 and 130 associated withtwo different slice IDs A and B along two different paths 506 and 508that terminate at two different destination end nodes (e.g., destinationcompute nodes) 512 and 514 in a datacenter.

FIG. 6 illustrates an example in which the DP circuit 205 of the HFE 105forwards two different data message flows 125 and 130 associated withtwo different slice IDs A and B to two different sets of machines 110and 112 in two different datacenters 605 and 610. In some embodiments,data message flows for different types of slices are sent to differentdatacenters for processing. For example, in some embodiments, datamessage flows for mobile telemetry data (e.g., telemetry slice) are sentto one datacenter, data message flows for device navigation data (i.e.,navigation slice) are sent to another datacenter, and VOIP data (e.g.,audio broadband slice) are sent to still another datacenter.

In some embodiments, the HFE that performs the network-slice basedoperations on data message flows is a middlebox appliance that performsthese operations as part of the middlebox services that it provides. Forinstance, FIG. 7 illustrates a load balancer 700 with a DP circuit 720that, based on the slice IDs associated with data message flows,performs a load balancing operation to distribute different data messageflows to different destination nodes in different clusters. This figureillustrates two different clusters 715 and 717 of destination nodes 710and 712, one with four destination nodes and the other with sixdestination nodes.

As shown by load-balancing rules 755, the load balancer 700 in someembodiments distributes the data message load among several differentdestinations in the network based on load balancing criteria that isselected based on the slice identifiers associated with these datamessage flows. Specifically, as shown, the DP circuit 720 of the loadbalancer 700 in some embodiments has a match-action table 750 thatincludes several rules 755, each of which has a match tuple 760 thatincludes a slice ID and an action tuple 765 that includes a set of loadbalancing criteria (e.g., a set of weight values).

After identifying the slice ID associated with a data message flow, theDP circuit 720 matches the flow's slice ID with the match tuple 760 ofone the rules 755, and then uses that matching rule's action tuple 765to select a set of load balancing criteria for distributing the datamessage flows associated with the matching slice ID among severaldestination nodes 710/712 in a cluster 715/717. Instead of selectingamong different destination nodes, the load balancing operation in otherembodiments distributes the data message load among several differentpaths to the same destination in the network, e.g., again based on loadbalancing criteria that is selected based on the slice identifiersassociated with these data message flows.

FIG. 8 illustrates a firewall appliance 800 with a DP circuit 820 that,based on the slice ID associated with data message flows, performs afirewall operation to determine whether to allow, to drop, or toredirect different data message flows. Specifically, as shown, the DPcircuit 820 of the firewall appliance 800 in some embodiments has amatch-action table 850 that includes several rules 855, each of whichhas (1) a match tuple 860 that includes a slice ID, and (2) an actiontuple 765 that specifies a firewall action, such as allow, drop orredirect.

After identifying the slice ID associated with a data message flow, theDP circuit 820 (1) matches the slice ID of a data message that it isprocessing with the match tuple 860 of one of the rules 855, (2) usesthat matching rule's action tuple 865 to identify the firewall action toperform on the data message, and then (3) performs the identifiedfirewall action on the data message. Other embodiments perform otherslice-based middlebox service operations (such as destination networkaddress translation, etc.).

In the middlebox embodiments (such as those described above by referenceto FIGS. 7 and 8) or the forwarding element embodiments (such as thosedescribed above by reference to FIGS. 1-6), the HFE uses one of severaltechniques to first identify the slice identifier associated with a datamessage flow, before using the slice identifier to perform its middleboxor forwarding operation on the flow. Several such techniques will now bedescribed by reference to FIGS. 9-12.

FIG. 9 illustrates a technique in which the HFE 900 offloads the sliceidentification for an initial set 902 of data messages in a new flow 980to an external device 905, which after identifying the slice ID for thenew data message flow, reconfigures a DP circuit 920 of the HFE 900 tobe able to identify the slice ID for a later set 904 of data messagesthat it receives in this flow. Under this approach, the HFE 900 forwardsan initial set 902 of one or more data messages that it receives in anew data message flow to the external device 905 (which is separate fromthe HFE), so that this external device can analyze these data messagesto identify the slice ID associated with the data message flow.

The device 905 in some embodiments is a standalone appliance. However,in the embodiment illustrated in FIG. 9, the device is a sliceidentifying VM 950 executing on a host computer to analyze data messagesreceived from the HFE 900 in order to ascertain their associated sliceidentifiers. U.S. patent application Ser. No. 16/443,812 discloses aprocess that the device 905 uses in some embodiments to identify theslice ID associated with a data message flow. U.S. patent applicationSer. No. 16/443,812 is incorporated herein by reference.

After identifying a slice ID for the initial set of data messages in thenew flow, the device 905 identifies a forwarding rule based on the sliceID, and then forwards these initial data messages to a next hop 960 thatit identifies based on this forwarding rule. In some embodiments, thedevice 905 has the same slice-based forwarding rules as the HFE 900 sothat the device 905 can forward the initial data messages that itreceives in the same manner that the HFE 900 will forward subsequentdata messages in the same flow once it has been reconfigured to do so.When the external device is the slice identifying VM 950, the VMspecifies the slice ID for a new flow, while the software forwardingelement 952 of its hypervisor 954 processes the forwarding rule toperform the forwarding operation that forwards the initial set of datamessages to their next hop 960.

Also, after identifying the slice ID for the initial set of datamessages in the new flow, the device 905 includes the slice ID and theflow's identifier (e.g., five or seven tuple identifier) in an API callto the HFE's CP circuit 925. This API call directs the CP circuit 925 tocreate a match-action record in the DP circuit 920 that has the flow IDas part of its match tuple and the slice ID as part of its action tuple.As shown, the CP circuit 925 then provides configuration data to the DPcircuit 920 to configure it to store a record that associates thereceived slice ID with the data message's attribute set.

Once the DP circuit 920 stores this record, it can use it to processsubsequent data messages in the flow 980 and to produce the slice ID forthese subsequent data messages. This slice ID then allows the DP circuit920 to match the subsequent data messages with a match-action recordthat has the slice ID and flow ID as part of its match tuple and the DPegress port ID as part of its action tuple. Through this match-actionrecord, the DP circuit 920 can identify the DP egress port ID for thesubsequent data messages, which are then sent through the identified DPegress port, to its associated FE egress port to the next hop 960.

In the example illustrated in FIG. 9, the HFE 900, the DP circuit 920and the external device 905 perform just a next-hop forwardingoperation. In other embodiments, these components perform otheroperations. For instance, in some embodiments, the DP circuit 920performs a slice-based middlebox operation. In some of theseembodiments, the external device 905 also processes the same slice-basedmiddlebox rules (e.g., firewall rules, etc.) as the DP circuit 920, sothat it can perform the same middlebox service operations on the initialset of data messages as the DP circuit 920 performs on the subsequentset of data messages in the flow.

FIG. 10 presents a process 1000 that conceptually illustrates theoperation of the DP circuit 920 of the HFE 900 in some embodiments. Asshown, the process 1000 starts when the DP circuit 920 receives (at1005) a data message to forward. At 1010, the process 1000 determineswhether the received data message's flow identifier (e.g., its five orseven tuple identifier) matches a slice-ID specifying match record. Ifnot, the data message is part of the initial set 902 of data messagesthat the DP circuit 920 has to forward to the slice-ID specifying device905.

Hence, at 1015, the process identifies the DP egress port associatedwith the slice-ID specifying device 905. Next, at 1020, the crossbarswitch 235 of the DP circuit 920 forwards the data message to the egresspipeline associated with the egress port identified at 1015. This egresspipeline then provides (at 1025) the data message to the identified DPegress port, which then sends the message to its associated FE egressport to transmit along the network.

A certain time period after sending (at 1025) the data message (andperhaps other data messages in the same flow) to the slice-ID specifyingdevice 905, the device 905 directs the CP circuit 925 to configure theDP circuit 920 with a match record that associates the data message'stuple with a slice ID. In response, the CP circuit 925 configures the DPcircuit 920 with this record, as conceptually illustrated by operation1030 in FIG. 10. To depict the partial dependence of this operation onthe external device 905 and the CP circuit 925, and its occurrence at aninstance in time that is dependent on the device 905 and circuit 925,FIG. 10 uses a dashed arrow to depict the flow from operation 1025 tooperation 1030. At 1030, the DP circuit 920 stores the recordassociating the data message's flow identifier with the slice IDprovided by the device 905 and the CP circuit 925.

When the DP circuit 920 matches (at 1010) a received data message's flowidentifier with a slice-ID specifying match record, the DP circuit 920retrieves (at 1035) the slice ID from the matching record. It then uses(at 1040) the retrieved slice ID to match the received data message witha next-hop forwarding rule that is stored in a match-action table thatassociates slice IDs with next hop egress ports.

After identifying (at 1040) the next-hop record and the egress port fromthis record, the crossbar switch 235 of the DP circuit 920 forwards (at1045) the data message to the egress pipeline associated with the egressport identified at 1040. This egress pipeline then provides (at 1050)the data message to the identified DP egress port, which then sends themessage to its associated FE egress port to transmit along the network.After 1050, the process 1000 ends.

In some embodiments, a similar process to process 1000 is used when theHFE and its CP/DP circuits are used in another type of forwardingelement or middlebox appliance. Specifically, in these embodiments, theDP circuit offloads the slice identification and processing of aninitial set of data messages in a new flow to an external device (e.g.,to a VM executing on a host computer). After identifying the slice IDfor the new data message flow, the external device in these embodimentsreconfigures the DP circuit (through its associated CP circuit of itsHFE) to be able to identify the slice ID for a later set of datamessages that it receives in this flow, so that the DP circuit canperform a slice-ID based forwarding or middlebox service operation onthese later set of data messages.

FIG. 11 illustrates another approach for an HFE to identify the slice IDassociated with a newly received data message flow. In this approach,the HFE's DP circuit 1120 forwards an initial set of one or more datamessages of the new flow to the HFE's CP circuit 1125 to analyze inorder to identify the slice ID associated with the new data messageflow. In some embodiments, the CP circuit executes a machine (e.g., acontainer or VM) or other program that uses the techniques described inthe above-incorporated U.S. patent application Ser. No. 16/443,812 toidentify a slice ID for a particular data message flow. Afteridentifying the slice ID for the new data message flow, the CP circuitprovides this slice identifier back to the DP circuit along with thedata messages in the initial set for processing.

Instead of providing the data messages that it analyzes to the DPcircuit to forward, the CP circuit in other embodiments forwards totheir next-hop destinations (e.g., through one or more NICs of theforwarding element or the CP circuit) the data messages that it receivesfrom the DP circuit, until the DP circuit is configured to perform theslice ID identification by the CP circuit. In some embodiments, the CPcircuit and DP circuit perform L2 forwarding operations and/or L3forwarding operations.

In some embodiments, the CP circuit 1125 includes a processor 1150(e.g., a multi-core processor) for executing programs and a memory 1175for storing programs. Two of the programs in the memory are aresource-sharing program, and a slice-identifying machine that executeson top of the resource sharing program in order to identify the sliceidentifier for the new data message flow. For instance, as shown, theprogram in some embodiments is a virtualization program 1110 (e.g., ahypervisor), and the machine is a virtual machine 1115. As furthershown, the program in other embodiments is a Linux operating system1120, and the machine is a container 1125. The VM 1115 or container 1125in some embodiments use the methodology disclosed in theabove-incorporated U.S. patent application Ser. No. 16/443,812 toidentify the slice ID that is associated with a data message.

In either the VM example or the container example, the CP circuit insome embodiments provides the DP circuit 1120 with configuration datathat configures it to store a match-action record that has (1) a matchtuple that includes the flow's identifier (e.g., five or seven tupleidentifier) and (2) an action tuple that includes its associated sliceID. After storing this record, the DP circuit 1120 uses it to generatethe slice ID in the data plane for each received data message in theflow by matching the message's flow ID with the record's match tuple.

This slice ID then allows the DP circuit 1120 to match the data messageswith a previously configured match-action record that has the slice IDand flow ID as part of its match tuple and the DP egress port ID as partof its action tuple. Through this match-action record, the DP circuit1120 can identify the DP egress port ID for the subsequent datamessages, which are then sent through the identified DP egress port, toits associated FE egress port, and then forwarded to a next hop. Whenthe DP circuit 1120 implements a middlebox service, the slice ID ismatched to a match-action rule that directs the DP circuit to perform amiddlebox operation, like the operation described above by reference toFIGS. 7 and 8.

Instead of having a machine (container or VM) executing on top of the CPprogram to identify the slice ID associated with a data message flow,the CP circuit executes a hypervisor that includes a context engine thatassociates flow attributes with slice identifiers. FIG. 12 illustratesan example of such a hypervisor 1205 and a context engine 1210 executingon the CP circuit 1225. In this example, after the hypervisor 1205starts to receive data messages of a new flow or its attribute set fromthe DP circuit 1220, it provides the received data message(s) or theflow's attribute set to the context engine 1210.

The context engine 1210 uses the attribute set of the received datamessage to identify the slice ID for the newly received flow. In someembodiments, the context engine executing on the CP circuit 1225receives records matching data message attributes with slice identifiersfrom context engines 1235 of hypervisors executing on host computers1230. The context engines 1235 on these host computers 1230 collectcontextual attributes relating to data message flows, starting from theVMs 1252 executing on their host computers, from guest introspection(GI) agents 1245 operating on these VMs, and stores these contextualattributes in the data store 1250. Based on the collected contextualattributes and preconfigured rules, a host-side context engine 1235 insome embodiments generates a slice identifier for a data message flow,e.g., by mapping the traffic type contained in the data message flow (asdetected by a GI agent executing on the VM or a DPI agent executing onits host) with a rule that associates traffic types to sliceidentifiers.

In some embodiments, the host context engines directly provide (e.g.,through overlay tunnels or RPC messages) to the CP circuit's contextengine 1210 records matching data message attributes with sliceidentifiers, while in other embodiments it indirectly provides this datathrough a set of one or more servers acting as a set of network managersor controllers. Several mechanisms for distributing contextualattributes (such as slice identifiers) between hypervisors running ondevices are described in U.S. Patent Applications 2018/0159733 and2018/0181423, which are incorporated herein by reference. Althoughseveral of the devices described in the U.S. Patent Applications2018/0159733 and 2018/0181423 are computers, some embodiments use themechanisms disclosed in U.S. Patent Applications 2018/0159733 and2018/0181423 to distribute contextual attributes (such as sliceidentifiers) to hypervisors running on forwarding elements and middleboxdevices.

FIG. 13 illustrates that in some embodiments a CP circuit 1325 of an HFE1300 executes one or more machines that perform one or more serviceoperations of a service chain for the data messages processed by theHFE's DP circuit 1320. Specifically, it shows a CP circuit memory 1330that stores a resource-sharing program, like a hypervisor or operatingsystem (e.g., Linux OS), that is executed by a CP processor 1335. Italso shows the CP circuit memory 1330 storing programs for implementingseveral service machines 1340 (such as VMs or containers) that servicechain operations on data messages forwarded to the CP circuit 1325 bythe DP circuit 1320. In some embodiments, the service chain operationsperformed by the service machines 1340 include a slice ID specifyingoperation.

Conjunctively, or alternatively, the service chain operations performedby the service machines 1340 in some embodiments include middleboxservice operations, as well as compute and forwarding operations. Asshown, the resource sharing program 1305 and the service machines 1340in some embodiments are a hypervisor 1305 a and service VMs (SVMs) 1340a. As further described below, the hypervisor 1305 a includes a softwareforwarding element 1360 (e.g., a software switch) for communicativelyconnecting the SVMs to each other and to one or more NICs of the CPcircuit 1325 through its ports 1390.

To execute such service machines, the CP circuit 1325 in someembodiments has a more powerful processor and more memory than theprocessors and memories that are typically used in some hardwareforwarding elements today. After performing one or more serviceoperations on a data message forwarded by the DP circuit 1320, the CPcircuit 1325 in some embodiments returns these data messages to the DPcircuit 1320 to forward the data message to its next destination in thenetwork.

In other embodiments, after performing one or more service operations ona data message forwarded by the DP circuit 1320, the CP circuit 1325forwards the data message to its next destination in the network througha NIC, the CP circuit 1325, or the HFE 1300. Also, in some embodiments,the CP circuit 1325 configures the DP circuit 1320 with the slice IDthat it identifies for a data message flow. However, in some of theseembodiments, instead of providing the data messages that it analyzes tothe DP circuit 1320 to forward, the CP circuit 1325 in these embodimentsforwards the data messages to its next-hop destination, until the DPcircuit 1320 is configured to perform the slice ID identification by theCP circuit 1325. In some embodiments, the CP circuit 1325 and DP circuit1320 perform L2 forwarding operations and/or L3 forwarding operations.

The machines executed by the CP circuit 1325 serve as a virtual dataplane, while the DP circuit 1320 serves as a physical data plane. Inother words, the HFE 1300 has two concurrently running data planes, aphysical one implemented by the DP circuit 1320 and another virtual oneimplemented by the CP circuit 1325 executing the service machines 1340.In some embodiments, the HFE 1300 uses its virtual data plane(implemented by its CP circuit 1325) to process data messages that itcannot process in its physical DP circuit, e.g., uses its virtual dataplane to produce a flow's slice ID, or to perform a service operation ina service chain.

In the embodiments where the resource sharing program 1305 of the HFE CPcircuit 1325 is a hypervisor 1305 a, one or more software forwardingelements execute on this hypervisor to implement the HFE's virtual dataplane. Example of such software forwarding elements include a softwareswitch (e.g., ESX switch running on an ESX hypervisor), a softwarerouters, etc. In some embodiments, this software forwarding elementprocesses the data messages that the CP circuit 1325 receives from theDP circuit 1320 to forward the data messages to SVMs 1340 a executing onthe hypervisor 1305 a and/or to identify for the data messages the nexthops in the network.

Along with software forwarding elements on other HFEs and/or on hostcomputers, the software forwarding element executing on the CP circuit1325 of an HFE 1300 in some embodiments implements one or more logicalforwarding elements that span multiple HFEs and/or multiple hostcomputers. Hence, in some embodiment, the software forwarding element ofan HFE's CP circuit performs logical forwarding operations (e.g., lookupoperations based on logical network identifiers).

In some embodiments, the hypervisors that execute on the CP circuits ofthe HFEs are the same or similar to the hypervisors executing on thehost computers in the network. FIG. 14 illustrates one such example. Inthis example, the similar or identical hypervisors provide a commonplatform through which a common set of managers 1405 and controllers1410 manage and control the HFEs 1400, the host computers 1450, and theSFEs 1455 executing on the host computers 1450.

In some embodiments, the managers 1405 and controllers 1410 manage andcontrol the HFE's CP circuit 1425 like they manage and/or controller thehost computers 1450 and the host SFEs 1455. For instance, through thecommon hypervisor platform, the managers 1405 and controllers 1410define in some embodiments logical forwarding elements (e.g., logicaloverlay forwarding elements) that span across multiple softwareforwarding elements of host computers and multiple DP circuits of HFEs.

Also, through this common platform, the managers 1405 and controllers1410 configure the host SFEs 1455 and the HFE DP circuits 1420 toperform sliced-based operations based on the same slice identifiers.Examples of such slice-based operations include slice-based forwardingoperations and/or slice-based middlebox operations. Through the commonhypervisor platform, the managers 1405 and the controllers 1420 in someembodiments use a common set of slice identifiers to define a common setof network slices across hardware and software SDDC resources, includingHFEs and host computers executing SFEs and middlebox instances.

The hardware and software resources in some embodiments use the commonslice identifiers to perform their operations (e.g., to select rulesthat they have to process). The common slice identifiers are also usedby the managers 1405 and the controllers 1410 to define different setsof dedicated compute and networking resources in the SDDC for differentnetwork slices, as described above.

In addition to configuring the host SFEs 1455 and the HFE DP circuits1420 to perform sliced-based operations, the managers 1405 and thecontrollers 1410 in some embodiments can also configure the SFEs andHFEs to also perform network operations based on more general securitygroup identifiers. Examples of more general security groups include portgroups, such as datacenter port groups, management port groups, virtualstorage port groups, VM mobility port groups, etc. A port group ID insome embodiments is a way to associate certain ports in a datacentertogether in order to apply the same forwarding and/or service policy onthe ports.

In some embodiments, the managers 1405 and the controllers 1410configure the HFE DP circuits 1420 by interacting with the HFE CPcircuits 1425. Specifically, in some embodiments, the managers 1405 andthe controllers 1410 use the hypervisors 1430 to provide configurationdata and contextual data to the HFE CP circuits 1425, so that the CPcircuits 1425 can configure their corresponding DP circuits 1420 toperform slice-based forwarding operations and/or slice-based middleboxoperations.

In some embodiments, the managers 1405 and controllers 1410 use thehypervisors 1430 to deploy and configure compute elements that executeon the CP circuits 1425 of the HFEs 1400 and on host computers 1450. Inother embodiments, the compute managers 1405 and compute controllers1410 do not deploy and configure compute elements to execute on the CPcircuits of the HFEs 1400.

The separate clusters of managers 1405 and controllers 1410 in FIG. 14provide separate management and control planes for managing andcontrolling the hypervisor 1435 resources on the host computer 1450 andthe HFEs 1400. In some embodiments, the managers 1405 define resourceson the host computers 1450 and HFEs 1400, while the controllers 1410configure these resources. Other embodiments, however, do not haveseparate management and control planes for managing/controlling theseresources, but rather use just one cluster of servers to do both themanagement and control plane operations.

FIG. 15 illustrates that in some embodiments the hypervisors 1505executing on the HFE's CP circuit 1525 uses a common data modelabstraction 1555 as the hypervisors 1510 executing on host computers1550. The hypervisors 1505 and 1510 use different translators 1515 and1517 to convert respective communications to the HFE DP circuit 1520 andthe host NIC 1525 into data formats decipherable by the DP circuit 1520and the NIC 1527. These translators also convert communications from theDP circuit 1520 and the NIC 1527 to the hypervisors 1505 and 1510 backinto the common data model format 1555.

These translators are implemented as plugins in some embodiments. Also,in some embodiments, no translator is used for the communicationsbetween the hypervisor 1510 and the host NIC 1527, as the common datamodel abstraction in these embodiments is a data model defined for thehost NICs. Such embodiments just use a translator to convert thehypervisor communication of the data plane circuit from a NIC data modelformat to a DP circuit model format, and to perform the reversetranslation.

FIG. 16 illustrates an example of using a slice-based HFE as an edgedevice 1600 of an SD-WAN (software-defined wide access network). Thisedge HFE operates at a particular local area network (LAN) of an entityto connect multiple devices 1610 (e.g., computers, tablets, smartphones,etc.) at this location to an entity's WAN through multiple networklinks, such as MPLS link 1602, broadband Internet link 1604, and 5Gwireless link 1606. The WAN spans multiple networks 1620 (e.g., aprivate telecommunication network, the Internet, an MPLS provider'snetwork, etc.) to connect different locations (e.g., differentdatacenters and branches) served by different LANs.

For each data message flow that it processes, the edge HFE 1600identifies the slice ID associated with the data message flow, selects anetwork link (e.g., a link 1602, 1604, or 1606) for this slice ID (e.g.,uses the slice ID to identify a link selection rule, and then select thelink specified by this rule), and then routes the data message flow toits destination along the selected network link. In some embodiments,the data message flow has a header (e.g., an encapsulation header) thatidentifies its slice ID. In other embodiments, the edge HFE isconfigured with rules that associate different flow IDs with slice IDs.In still other embodiments, the edge HFE uses an external device (suchas the slice ID specifying circuit 905 of FIG. 9), or a module/machineof its CP circuit (as shown in FIG. 11 or 12) to identify the slice IDfor the data message flow.

FIG. 17 illustrates another SD-WAN example. In this example, aslice-based HFE 1700 is used as a multi-tenant public cloud gateway toconnect different LAN nodes of different tenants based on a tenant sliceID. For each tenant, the public cloud gateway 1700 establishes thetenant's SD-WAN by connecting two or more LANs of the tenant, which areoften at different physical locations. In this example, the public cloudgateway 1700 connects a branch office 1702 and a datacenter 1704 oftenant A, and a branch office 1706 and a datacenter 1708 of a tenant B.

For each data message flow that it processes, the gateway 1700identifies the slice ID associated with the data message flow, selects anext-hop routing table associated with this slice ID, and then routesthe data message flow to its destination by using the next-hop routingtable. The gateway identifies the slice ID differently in differentembodiments, e.g., extracts it from the data message flow's header(e.g., an encapsulation header) in some embodiments, uses apreconfigured table that associates flow IDs with slice IDs in otherembodiments, or uses an external device, or a module/machine of its CPcircuit, in still other embodiments.

The HFEs of some embodiments can be configured to implement ingress-sideflow controls for a device by collecting statistics regarding theiregress-side traffic to the device, reporting the collected statistics toa set of servers, and receiving new egress side limits to adjust theamount of flows forwarded to the device by the HFEs. In someembodiments, HFEs drop data messages to stay under thresholds specifiedby the egress-side limits that they receive, or delay the transmissionof the data messages when reaching such thresholds.

FIG. 18 illustrates one such technique in which several HFEs 1800implement ingress-flow controls for a device 1805, which can be a hostcomputer, a machine executing on a host computer, a server, or any otherkind of device. In this example, each HFE generates statistics regardingthe data message flows that it sends to the device 1805. The HFEs insome embodiments can generate any number of different statistics, suchas number of data messages, byte count, etc. These statistics in someembodiments are flow specific, i.e., the HFEs compute statistic valuesfor each of several different flows. The flows can be individual five-or seven-tuple flows, or they can be aggregate flows that includeseveral individual flows (e.g., aggregate flow that encompasses allindividual flows with the same source and destination IP addresses). Inaddition to being flow based, or instead of being flow based, the HFEgenerates the statistics for each slice ID in some embodiments, in orderto quantify how much traffic of a particular network slice the devicereceives.

The HFEs provide the generated statistics to the set of servers 1820(e.g., controllers or managers), which then analyze the statistics todetermine whether the amount of traffic forwarded to the device 1805exceeds a threshold value. When this threshold value is reached, theserver set 1820 proves new egress limits (e.g., for all flows, forcertain flows, for certain slice IDs, or for certain combination of flowand slice IDs, etc.) to the HFEs. The HFEs then use these new egresslimits to control how much data messages that they send to the device1805 (e.g., for all flows, for certain flows, for certain slice IDs, orfor certain combination of flow and slice IDs, etc.).

As mentioned above, HFEs in some embodiments drop data messages to stayunder thresholds specified by the egress-side limits that they receive,or delay the transmission of the data messages when reaching suchthresholds. Also, in some embodiments, the server set 1820 candistribute the same new egress limit to each HFE 1800, or different newegress limits to different HFEs 1800, in order to adjust the datamessage flow to the host 1805.

FIG. 19 illustrates a process 1900 that the server set 1820 performs insome embodiments to control the ingress data message load for aparticular slice ID to the device 1805. This process is used in someembodiments to ensure that the device 1805 does not process more than acertain amount of data messages for a particular slice. As shown, theprocess starts (at 1905) by distributing to the HFEs 1800 egress-sidelimits for the data message load (e.g., number of bytes per second,etc.) of a particular slice that the HFEs can forward to the device1805.

In some embodiments, the process distributes these limits through an APIcall to the HFE CP circuit, which then configures the HFE DP circuit toobserve these limits. As mentioned above, HFEs in some embodiments dropdata messages to stay under thresholds specified by the egress-sidelimits that they receive, or delay the transmission of the data messageswhen reaching such thresholds. Also, in some embodiments, the server set1820 can distribute the same egress limit to each HFE 1800, or differentegress limits to different HFEs 1800.

A time period later, the server set collects (at 1910) statistics fromthe HFEs regarding the data message load for the particular sliceforwarded to the device 1805. The collected statistics in someembodiments relate to the limits distributed by the server set. Forinstance, when the limits are expressed in terms of number of bytes persecond, the collected statistics express an average number of bytes persecond that the HFEs distributed to the device, or a total number ofbytes distributed during the time period, for the particular slice.

At 1915, the process aggregates statistics collected from the HFEs forthe particular slice. It then determines (at 1920) whether the aggregatestatistics exceeds a desired threshold amount (e.g., a desired totalnumber of bytes per second). If not, the process returns to 1910 to waitthe next batch of reported statistics. On the other hand, when theaggregate statistics for the particular slice exceeds a thresholdamount, the process calculates (at 1925) new egress limits on the datamessage flows of the particular slice that can be forwarded to thedevice.

For instance, if the device should not receive more than 100Mbits/second for the particular slice, the server set 1820 mightinitially distribute a 50 Mbits/second limit to each HFE, based on anassumption that the HFEs will never be running more than 50% of thislimit to the device 1805. However, the collected statistics might showthat in a time period three HFEs sent 35 Mbits/second, 45 Mbits/secondand 50 Mbits/second to the device, and the aggregate of this exceeds theoverall limit by 100 Mbits/second. Hence, the server set might cut theindividual limits for each of the HFEs to 33 Mbits/second to ensure thattheir aggregate cannot exceeds the overall limit.

After calculating the new limits (at 1925), the process distributes (at1930) these new limits to the HFEs. Again, in some embodiments, theprocess distributes these limits through an API call to the HFE CPcircuit, which then configures the HFE DP circuit to observe theselimits. As mentioned above, HFEs in some embodiments drop data messagesto stay under thresholds specified by the new egress-side limits thatthey receive, or delay the transmission of the data messages whenreaching such thresholds. Also, in some embodiments, the server set 1820can distribute the same new egress limit to each HFE 1800, or differentnew egress limits to different HFEs 1800. After 1930, the processreturns to 1910 to wait the next batch of reported statistics.

Many of the above-described features and applications are implemented assoftware processes that are specified as a set of instructions recordedon a computer readable storage medium (also referred to as computerreadable medium). When these instructions are executed by one or moreprocessing unit(s) (e.g., one or more processors, cores of processors,or other processing units), they cause the processing unit(s) to performthe actions indicated in the instructions. Examples of computer readablemedia include, but are not limited to, CD-ROMs, flash drives, RAM chips,hard drives, EPROMs, etc. The computer readable media does not includecarrier waves and electronic signals passing wirelessly or over wiredconnections.

In this specification, the term “software” is meant to include firmwareresiding in read-only memory or applications stored in magnetic storage,which can be read into memory for processing by a processor. Also, insome embodiments, multiple software inventions can be implemented assub-parts of a larger program while remaining distinct softwareinventions. In some embodiments, multiple software inventions can alsobe implemented as separate programs. Finally, any combination ofseparate programs that together implement a software invention describedhere is within the scope of the invention. In some embodiments, thesoftware programs, when installed to operate on one or more electronicsystems, define one or more specific machine implementations thatexecute and perform the operations of the software programs.

FIG. 20 conceptually illustrates a computer system 2000 with which someembodiments of the invention are implemented. The computer system 2000can be used to implement any of the above-described hosts, CP circuits,controllers, and managers. As such, it can be used to execute any of theabove described processes. This computer system includes various typesof non-transitory machine readable media and interfaces for variousother types of machine readable media. Computer system 2000 includes abus 2005, processing unit(s) 2010, a system memory 2025, a read-onlymemory 2030, a permanent storage device 2035, input devices 2040, andoutput devices 2045.

The bus 2005 collectively represents all system, peripheral, and chipsetbuses that communicatively connect the numerous internal devices of thecomputer system 2000. For instance, the bus 2005 communicativelyconnects the processing unit(s) 2010 with the read-only memory 2030, thesystem memory 2025, and the permanent storage device 2035.

From these various memory units, the processing unit(s) 2010 retrieveinstructions to execute and data to process in order to execute theprocesses of the invention. The processing unit(s) may be a singleprocessor or a multi-core processor in different embodiments. Theread-only-memory (ROM) 2030 stores static data and instructions that areneeded by the processing unit(s) 2010 and other modules of the computersystem. The permanent storage device 2035, on the other hand, is aread-and-write memory device. This device is a non-volatile memory unitthat stores instructions and data even when the computer system 2000 isoff. Some embodiments of the invention use a mass-storage device (suchas a magnetic or optical disk and its corresponding disk drive) as thepermanent storage device 2035.

Other embodiments use a removable storage device (such as a floppy disk,flash drive, etc.) as the permanent storage device. Like the permanentstorage device 2035, the system memory 2025 is a read-and-write memorydevice. However, unlike storage device 2035, the system memory is avolatile read-and-write memory, such as random access memory. The systemmemory stores some of the instructions and data that the processor needsat runtime. In some embodiments, the invention's processes are stored inthe system memory 2025, the permanent storage device 2035, and/or theread-only memory 2030. From these various memory units, the processingunit(s) 2010 retrieve instructions to execute and data to process inorder to execute the processes of some embodiments.

The bus 2005 also connects to the input and output devices 2040 and2045. The input devices enable the user to communicate information andselect commands to the computer system. The input devices 2040 includealphanumeric keyboards and pointing devices (also called “cursor controldevices”). The output devices 2045 display images generated by thecomputer system. The output devices include printers and displaydevices, such as cathode ray tubes (CRT) or liquid crystal displays(LCD). Some embodiments include devices such as touchscreens thatfunction as both input and output devices.

Finally, as shown in FIG. 20, bus 2005 also couples computer system 2000to a network 2065 through a network adapter (not shown). In this manner,the computer can be a part of a network of computers (such as a localarea network (“LAN”), a wide area network (“WAN”), or an Intranet), or anetwork of networks (such as the Internet). Any or all components ofcomputer system 2000 may be used in conjunction with the invention.

Some embodiments include electronic components, such as microprocessors,storage and memory that store computer program instructions in amachine-readable or computer-readable medium (alternatively referred toas computer-readable storage media, machine-readable media, ormachine-readable storage media). Some examples of such computer-readablemedia include RAM, ROM, read-only compact discs (CD-ROM), recordablecompact discs (CD-R), rewritable compact discs (CD-RW), read-onlydigital versatile discs (e.g., DVD-ROM, dual-layer DVD-ROM), a varietyof recordable/rewritable DVDs (e.g., DVD-RAM, DVD-RW, DVD+RW, etc.),flash memory (e.g., SD cards, mini-SD cards, micro-SD cards, etc.),magnetic and/or solid state hard drives, read-only and recordableBlu-Ray® discs, ultra-density optical discs, any other optical ormagnetic media, and floppy disks. The computer-readable media may storea computer program that is executable by at least one processing unitand includes sets of instructions for performing various operations.Examples of computer programs or computer code include machine code,such as is produced by a compiler, and files including higher-level codethat are executed by a computer, an electronic component, or amicroprocessor using an interpreter.

While the above discussion primarily refers to microprocessor ormulti-core processors that execute software, some embodiments areperformed by one or more integrated circuits, such as applicationspecific integrated circuits (ASICs) or field programmable gate arrays(FPGAs). In some embodiments, such integrated circuits executeinstructions that are stored on the circuit itself.

As used in this specification, the terms “computer”, “server”,“processor”, and “memory” all refer to electronic or other technologicaldevices. These terms exclude people or groups of people. For thepurposes of the specification, the terms “display” or “displaying” meandisplaying on an electronic device. As used in this specification, theterms “computer readable medium,” “computer readable media,” and“machine readable medium” are entirely restricted to tangible, physicalobjects that store information in a form that is readable by a computer.These terms exclude any wireless signals, wired download signals, andany other ephemeral or transitory signals.

While the invention has been described with reference to numerousspecific details, one of ordinary skill in the art will recognize thatthe invention can be embodied in other specific forms without departingfrom the spirit of the invention. Thus, one of ordinary skill in the artwould understand that the invention is not to be limited by theforegoing illustrative details, but rather is to be defined by theappended claims

1. A method of performing operations on a data message, the methodcomprising: at a hardware forwarding element (HFE) in the network,receiving the data message; identifying a network slice associated withthe received data message, said network slice associated with a set ofoperations to perform on the data message by a plurality of networkelements including a set of machines executing on a set of computers inthe network; and processing the data message based on a rule thatapplies to data messages associated with the identified network slice.2. The method of claim 1, wherein the HFE has a data plane (DP) circuit;identifying the network slice comprises identifying a slice identifierassociated with the network slice; processing the data message comprisesusing the slice identifier to identify in the DP circuit a rule thatspecifies an operation for the DP circuit to perform on the datamessage, and performing the identified operation on the data message. 3.The method of claim 2, wherein the rule has a rule identifier thatcomprises the slice identifier, and using the slice identifier comprisesmatching the identified slice identifier to the rule identifier of therule.
 4. The method of claim 2, wherein the rule is a forwarding rulethat forwards the data message to a particular port of the HFE.
 5. Themethod of claim 4, wherein the forwarding rule is a next-hop forwardingrule that selects between different next hops of different paths to samedestinations in the network.
 6. The method of claim 4, wherein theforwarding rule is a next-hop forwarding rule that selects betweendifferent next hops of different paths to different destinations in thenetwork.
 7. The method of claim 4, wherein the particular portcorresponds to a connection to a second datacenter, wherein the ruleselects between different ports that connect to different datacenters.8. The method of claim 2, wherein the rule is a forwarding rule of alogical forwarding element implemented by the HFE.
 9. The method ofclaim 2, wherein the rule is a firewall rule that determines whether todrop or allow the data message.
 10. The method of claim 2, wherein therule is a middlebox service rule is associated with a middlebox serviceoperation to perform on the data message.
 11. The method of claim 10,wherein the middlebox service operation is a load balancing operationthat distributes the load among a plurality of different destinations ordifferent paths in the network.
 12. The method of claim 1, wherein theset of operations associated with a network slice comprise a pluralityof operations performed by a plurality of devices in the network. 13.The method of claim 12, wherein the plurality of device comprises aplurality of machines executing on host computers to perform at least asubset of the plurality of operations.
 14. The method of claim 13,wherein the machines comprise at least one of virtual machines andcontainers.
 15. The method of claim 12, wherein the plurality ofoperations comprises virtual network functions (VNFs) implemented by atelecommunication company.
 16. The method of claim 1, wherein theidentified network slice corresponds to a particular type of traffic andthe HFE forwards the data message to a device that is a first device ina set of devices for processing the particular type of traffic.
 17. Themethod of claim 16, wherein the set of devices implements a servicechain associated with the identified network slice.
 18. The method ofclaim 1, wherein identifying the network slice comprises identifying aslice identifier associated with the network slice by: forwarding thedata message to a device separate from the HFE, and receiving from thedevice the slice identifier associated with the data message.
 19. Themethod of claim 18, wherein the device is a standalone appliance. 20.The method of claim 18, wherein the device is a host computer on which amachine executes to analyze data messages received from the HFE in orderto ascertain their associated slice identifiers.
 21. The method of claim18, wherein the HFE has a data plane (DP) circuit and a control plane(CP) circuit; identifying the network slice comprises identifying aslice identifier associated with the network slice by forwarding thedata message from the DP circuit to the CP circuit.
 22. The method ofclaim 21, wherein the CP circuit executes a resource sharing program anda machine executes on top of the resource sharing program to identifythe slice identifier for the data message.
 23. The method of claim 22,wherein the program is a virtualization program or a Linux operatingsystem.
 24. The method of claim 22, wherein the machine is a virtualmachine or a container.
 25. The method of claim 21, wherein the CPcircuit executes a hypervisor that includes a context engine thatassociates data message attributes with slice identifiers, and thecontext engine uses a set of attributes of the received message toidentify the slice identifier for the received message.
 26. The methodof claim 25, wherein the context engine receives records matching datamessage attributes with slice identifiers from context engines ofhypervisors executing on host computers.
 27. The method of claim 25,wherein the context engine receives records matching data messageattributes with slice identifiers from a set of one or more serversacting as a set of network managers or controllers.
 28. The method ofclaim 1, wherein the HFE has a data plane (DP) circuit and a controlplane (CP) circuit, and identifying the network slice comprisesidentifying a slice identifier associated with the network slice; the CPcircuit configures the DP circuit by providing configuration data toconfigure the DP circuit with rules to process data messages based ontheir associated slice identifiers.